import { bannerlist } from "../../../request/api"
const state = {
    bannerList: []

}

const getters = {
    //请求列表数据
    getBanner(state) {
        return state.bannerList
    }
}

const mutations = {
    REQ_BANNERLIST(state, payload) {
        state.bannerList = payload
    }

}
const actions = {
    getBannerListAction({ commit }) {
        bannerlist().then(res=>{
            // console.log(res);
            if(res.code==200){
                commit("REQ_BANNERLIST",res.list)
            }
        })
    }

}

export default {
    state,
    getters,
    mutations,
    actions,
    //开启命名空间
    namespaced: true
}